import zipfile
#读取压缩包内文件
# with   zipfile.ZipFile('这是一个压缩包.zip','r') as zipobj:
#     for filename in zipobj.namelist():
#         print(filename.encode('cp437').decode('gbk'))
    # print(zipobj.namelist())
#读取压缩包内文件信息
# with   zipfile.ZipFile('这是一个压缩包.zip','r') as zipobj:
#     for filename in zipobj.namelist():
#          info=zipobj.getinfo(filename)
#          new_filename=filename.encode('cp437').decode('gbk')
#          print(new_filename,info)
#解压压缩包内单个文件
# with   zipfile.ZipFile('这是一个压缩包.zip','r') as zipobj:
#     zipobj.extract('testread.txt','D:/sms')
#解压所有文件
# with   zipfile.ZipFile('这是一个压缩包.zip','r') as zipobj:
#     zipobj.extractall(path='/test',pwd=b'123123')
#创建压缩包
file_list=['python01.py','python02.py']
with   zipfile.ZipFile('个压缩包.zip','w') as zipobj:
    for file in file_list:
        zipobj.write(file)
        #w,a,r;a追加到压缩包中